<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>登录页</title>
    <link rel="stylesheet" href="css/normalize.css">
    <link rel="stylesheet" href="css/login.css">
    <script src="js/jquery-1.9.1.min.js"></script>
    <script src="js/factory/config.js"></script>
    <script src="js/login/SoftKey3W.js"></script>
</head>
<body onload="load()">
<div class="login">
    <h1>朝阳区市容智能审查系统</h1>
    <input type="text" id="loginName" placeholder="账号" required="required" />
    <input type="password" id="pin" placeholder="密码" required="required" />
    <input type="button" class="btn btn-primary btn-block btn-large" onclick="login()" value="登录">
</div>
</body>

<script type="text/javascript">

    function login(){
        var loginName = $("#loginName").val();
        var password = $("#pin").val();
        //ajax去服务器端校验
        $.ajax({
            url :   prefixUrl + "user/admin/login",
            type:   "post",
            data:JSON.stringify({
                userId : loginName,
                pin  : password
            }),
            contentType:"application/json;",
            success:function(data) {
                if(data.code==0){
                    location.href = prefixUrl + "/check.html";
                }else{
                    alert(data.msg);
                }
            }
        });
    }
</script>
</html>